package org.wangp.business.user.repository.remote

import org.springframework.cloud.openfeign.FeignClient
import org.springframework.http.MediaType
import org.springframework.stereotype.Component
import org.springframework.web.bind.annotation.GetMapping
import org.wangp.business.user.domain.OrderDTO
import org.wangp.business.user.domain.UserDTO
import org.wangp.business.user.repository.remote.mock.OrderCenterFallback
import org.wangp.framework.core.domain.CommonResult

/**
 * @author wangpeng (๑•ᴗ•๑)
 * @since 2021/10/22 8:43
 */
@Component("IOrderCenter")
@FeignClient(name = "order-center",path = "oc",fallback = OrderCenterFallback::class,decode404 = true)
interface IOrderCenter {

	@GetMapping(path = ["order"], consumes = [MediaType.APPLICATION_JSON_VALUE])
	fun getOrdersByUser(userDTO: UserDTO): CommonResult<List<OrderDTO>>
}
